//
//  UIView+HYExtension.m
//  Object-CPlayGround
//
//  Created by 韩丛旸 on 16/7/18.
//  Copyright © 2016年 韩丛旸. All rights reserved.
//

#import "UIView+HYExtension.h"

@implementation UIView (HYExtension)

- (void)setHy_origin_x:(CGFloat)hy_origin_x
{
    CGRect frame = self.frame;
    frame.origin.x = hy_origin_x;
    self.frame = frame;
}

- (CGFloat)hy_origin_x
{
    return self.frame.origin.x;
}

- (void)setHy_origin_y:(CGFloat)hy_origin_y
{
    CGRect frame = self.frame;
    frame.origin.y = hy_origin_y;
    self.frame = frame;
}

- (CGFloat)hy_origin_y
{
    return self.frame.origin.y;
}

- (CGFloat)hy_max_x
{
    return CGRectGetMaxX(self.frame);
}

- (CGFloat)hy_max_y
{
    return CGRectGetMaxY(self.frame);
}

- (void)setHy_width:(CGFloat)hy_width
{
    CGRect frame = self.frame;
    frame.size.width = hy_width;
    self.frame = frame;
}

- (CGFloat)hy_width
{
    return self.frame.size.width;
}

- (void)setHy_height:(CGFloat)hy_height
{
    CGRect frame = self.frame;
    frame.size.height = hy_height;
    self.frame = frame;
}

- (CGFloat)hy_height
{
    return self.frame.size.height;
}


- (CGFloat)hy_mid_bounds_x
{
    return CGRectGetMidX(self.bounds);
}

- (CGFloat)hy_mid_bounds_y
{
    return CGRectGetMidY(self.bounds);
}

- (CGFloat)hy_center_x
{
    return CGRectGetMidX(self.frame);
}

- (CGFloat)hy_center_y
{
    return CGRectGetMidY(self.frame);
}

@end
